class_name UvMap
extends RefCounted

var uvs:Array[PackedVector2Array]

func generate_uvs():
	var div_count: int = Data["map_uv"]["div"]
	var u: float = 1.0/div_count
	var v: float = 1.0/div_count
	for y in div_count:
		for x in div_count:
			var uv:PackedVector2Array
			uv.push_back(Vector2(x*u,y*v))
			uv.push_back(Vector2(x*u+u,y*v))
			uv.push_back(Vector2(x*u,y*v+v))
			uv.push_back(Vector2(x*u+u,y*v+v))
			uvs.push_back(uv)
			pass
